*********************************************************
* Bankert, A., Del Ponte, A., Huddy, L. (2022)          *
* Partisanship in Times of Crisis - Evidence from Italy *
* Political Science Research and Methods                *
* Replication Do-File: Appendix                         *
*********************************************************

********************************************************************************
* Table A1 - Sample demographics and attrition by sample (CATI, CAWI, Overall) *
********************************************************************************
//Wave 1
tab Age_Cat01
tab Gender
tab Employment01
tab Education
tab noparty
tab PartyID_W1
tab Turnout_W5
sum Partisan_ID
sum Pol_Interest_W1

//Completed panel
tab Age_Cat01 if totalwaves==5
tab Gender if totalwaves==5
tab Employment01 if totalwaves==5
tab Education if totalwaves==5
tab noparty if totalwaves==5
tab PartyID_W1 if totalwaves==5
tab Turnout_W5 if totalwaves==5
sum Partisan_ID if totalwaves==5
sum Pol_Interest_W1 if totalwaves==5

//by CATI/CAWI
sort Sample
//Wave 1
by Sample: tab Age_Cat01
by Sample: tab Gender
by Sample: tab Employment01
by Sample: tab Education
by Sample: tab noparty
by Sample: tab PartyID_W1
by Sample: tab Turnout_W5
by Sample: sum Partisan_ID
by Sample: sum Pol_Interest_W1

//Completed panel
by Sample: tab Age_Cat01 if totalwaves==5
by Sample: tab Gender if totalwaves==5
by Sample: tab Employment01 if totalwaves==5
by Sample: tab Education if totalwaves==5
by Sample: tab noparty if totalwaves==5
by Sample: tab PartyID_W1 if totalwaves==5
by Sample: tab Turnout_W5 if totalwaves==5
by Sample: sum Partisan_ID if totalwaves==5
by Sample: sum Pol_Interest_W1 if totalwaves==5

//difference in Partisan Identity Strength by CATI vs. CAWI
//Wave 1
ttest Partisan_ID, by(Sample)

//Completed panel
ttest Partisan_ID if totalwaves==5, by(Sample)

//look at Partisan Identity Strength of major parties
//Wave 1
//PD
sum Partisan_ID if PartyID_W1 == 4
//PDL
sum Partisan_ID if PartyID_W1 == 6
//M5S
sum Partisan_ID if PartyID_W1 == 12

//Completed panel
//PD
sum Partisan_ID if (PartyID_W1 == 4 & totalwaves==5)
//PDL
sum Partisan_ID if (PartyID_W1 == 6 & totalwaves==5)
//M5S
sum Partisan_ID if (PartyID_W1 == 12 & totalwaves==5)


************************************************
* Table A3 - Party affiliations across samples *
************************************************
//Wave 1
tab PartyID_W1

//Completed panel
tab PartyID_W1 if totalwaves==5

//By CATI vs. CAWI
//Wave 1
by Sample: tab PartyID_W1

//Completed panel
by Sample: tab PartyID_W1 if totalwaves==5

************************************************************************
* Table A4 - Description and summary statistics of dependent variables *
************************************************************************
***********************
* Dependent Variables *
***********************
//Voting for M5S (partisans only)
sum Grillo_ChamberorSenate

//Voting for M5S (partisans and non-partisans)
sum Grillo_ChamberorSenate_all if totalwaves == 5

//Ratings of Grillo
sum Grillo_W5

//Adjusted Ratings of Grillo [Grillo ratings minus average of every other leader's ratings]
sum NewGrillo_CorrectedforNoParty_W5

//Voting for the In-Party
sum VotedInparty_SenateorChamber_W5

//In-Party Leader Ratings
sum Inparty_Rating_W5

*************************
* Independent Variables *
*************************
//Partisan Identity Strength
sum Partisan_ID if totalwaves == 5

//Education
sum Education01 if totalwaves == 5

//Age
sum Age_Cat01 if totalwaves == 5

//Employment
sum Employment01 if totalwaves == 5

*********************************************************************************
* Table A5 - In-party vote using an issue-based ideology scale (IT_Ideology_IV) *
*********************************************************************************
*(1)
logit VotedInparty_SenateorChamber_W5 Partisan_ID IT_Ideology_IV Education01 Age_Cat01 Employment01 Sample if totalwaves==5 & Turnout_W5==1

*(2) Interaction issue alignment scale x Party
logit VotedInparty_SenateorChamber_W5 Partisan_ID c.IT_Ideology_IV##i.rightWing_W1 c.IT_Ideology_IV##i.leftWing_W1 IT_Ideology_IV Education01 Age_Cat01 Employment01 Sample if totalwaves==5 & Turnout_W5==1


*****************************************************************
* Table A6 - Voting for M5S using an issue-based ideology scale *
*****************************************************************
logit Grillo_ChamberorSenate c.Partisan_ID##i.rightWing_W1 c.Partisan_ID##i.leftWing_W1 IT_Ideology_IV  Education01 Age_Cat01 Employment01 Sample if totalwaves==5 & Turnout_W5==1


*******************************************************************
* Table A7 - Rating of Grillo using an issue-based ideology scale *
*******************************************************************
reg Grillo_W5 c.Partisan_ID##i.rightWing_W1 c.Partisan_ID##i.leftWing_W1 IT_Ideology_IV  Education01 Age_Cat01 Employment01 Sample if totalwaves==5 

************************************************************
* Table A8 - Vote for the in-party (CATI vs. CAWI samples) *
************************************************************
*(1) In-party Vote, CATI
logit VotedInparty_SenateorChamber_W5 Partisan_ID  rightWing_W1 leftWing_W1 Education01 Age_Cat01 Employment01 if totalwaves==5 & PartyID_W1!=12 & Sample==0 & Turnout_W5==1

*(2) In-party Vote, CAWI
logit VotedInparty_SenateorChamber_W5 Partisan_ID  rightWing_W1 leftWing_W1 Education01 Age_Cat01 Employment01 if totalwaves==5 & PartyID_W1!=12 & Sample==1 & Turnout_W5==1

*(3) In-party Vote w. interaction, CATI
logit VotedInparty_SenateorChamber_W5 c.Partisan_ID##i.rightWing_W1 c.Partisan_ID##i.leftWing_W1  Education01 Age_Cat01 Employment01 if totalwaves==5 & PartyID_W1!=12 & Sample==0 & Turnout_W5==1

*(4) In-party Vote w. interaction, CAWI
logit VotedInparty_SenateorChamber_W5 c.Partisan_ID##i.rightWing_W1 c.Partisan_ID##i.leftWing_W1  Education01 Age_Cat01 Employment01 if totalwaves==5 & PartyID_W1!=12 & Sample==1 & Turnout_W5==1


*****************************************************
* Table A9 - Voting for M5S (CATI vs. CAWI samples) *
*****************************************************
*(1) Partisan ID interaction, CATI
logit Grillo_ChamberorSenate c.Partisan_ID##i.rightWing_W1 c.Partisan_ID##i.leftWing_W1 Education01 Age_Cat01 Employment01 if totalwaves==5 & Sample==0 & Turnout_W5==1

*(2) Partisan ID interaction, CAWI
logit Grillo_ChamberorSenate c.Partisan_ID##i.rightWing_W1 c.Partisan_ID##i.leftWing_W1 Education01 Age_Cat01 Employment01 if totalwaves==5 & Sample==1 & Turnout_W5==1

*****************************************************
* Table A10 - Grillo rating (CATI vs. CAWI samples) *
*****************************************************
*(1)Partisan ID, CATI
reg Grillo_W5 c.Partisan_ID##i.rightWing_W1 c.Partisan_ID##i.leftWing_W1 Education01 Age_Cat01 Employment01 if totalwaves==5 & Sample==0

*(2)Partisan ID, CAWI
reg Grillo_W5 c.Partisan_ID##i.rightWing_W1 c.Partisan_ID##i.leftWing_W1 Education01 Age_Cat01 Employment01 if totalwaves==5 & Sample==1

***************************************************************************************************************
* Table A11 - Grillo voting and rating among all respondents, including non-partisans (CATI vs. CAWI samples) *
***************************************************************************************************************
*(1) Voting, CATI
logit Grillo_ChamberorSenate_all noparty Education01 Age_Cat01 Employment01 if totalwaves==5 & Sample==0 & Turnout_W5==1
*(2) Voting, CAWI
logit Grillo_ChamberorSenate_all noparty Education01 Age_Cat01 Employment01 if totalwaves==5 & Sample==1 & Turnout_W5==1

*(3) Interaction with Education, CATI
logit Grillo_ChamberorSenate_all noparty##c.Education01 Age_Cat01 Employment01 if totalwaves==5 & Sample==0 & Turnout_W5==1
*(4) Interaction with Education, CAWI
logit Grillo_ChamberorSenate_all noparty##c.Education01 Age_Cat01 Employment01 if totalwaves==5 & Sample==1 & Turnout_W5==1

*(5) Rating, CATI
reg NewGrillo_CorrectedforNoParty_W5 noparty Education01 Age_Cat01 Employment01 if totalwaves==5 & Sample==0
*(6) Rating, CAWI
reg NewGrillo_CorrectedforNoParty_W5 noparty Education01 Age_Cat01 Employment01 if totalwaves==5 & Sample==1

*(7) Interaction with Education, CATI
reg NewGrillo_CorrectedforNoParty_W5 noparty##c.Education01 Education01 Age_Cat01 Employment01 if totalwaves==5 & Sample==0
*(8) Interaction with Education, CAWI
reg NewGrillo_CorrectedforNoParty_W5 noparty##c.Education01 Education01 Age_Cat01 Employment01 if totalwaves==5 & Sample==1

***********************************************************************
* Table A12 - In-party vote without interactions with party variables *
***********************************************************************
*(1)
logit VotedInparty_SenateorChamber_W5 Partisan_ID rightWing_W1 leftWing_W1 Education01 Age_Cat01 Employment01 Sample if totalwaves==5 & PartyID_W1!=12 & Turnout_W5==1

*(2)
logit VotedInparty_SenateorChamber_W5 PID_Strength rightWing_W1 leftWing_W1 Education01 Age_Cat01 Employment01 Sample if totalwaves==5 & PartyID_W1!=12 & Turnout_W5==1


************************************************************************
* Table A13 - Voting for M5S without interactions with party variables *
************************************************************************
*(1)
logit Grillo_ChamberorSenate Partisan_ID rightWing_W1 leftWing_W1 Education01 Age_Cat01 Employment01 Sample if totalwaves==5 & Turnout_W5==1

*(2)
logit Grillo_ChamberorSenate PID_Strength rightWing_W1 leftWing_W1 Education01 Age_Cat01 Employment01  Sample if totalwaves==5 & Turnout_W5==1

**************************************************************************
* Table A14 - Rating of Grillo without interactions with party variables *
**************************************************************************
*(1)Partisan ID
reg Grillo_W5 Partisan_ID rightWing_W1 leftWing_W1 Education01 Age_Cat01 Employment01 Sample if totalwaves==5

*(2)
reg Grillo_W5 PID_Strength rightWing_W1 leftWing_W1 Education01 Age_Cat01 Employment01  Sample if totalwaves==5


*****************************************************************************************************************************
* Table A15 - Voting for M5S and ratings of Grillo among partisans and non-partisans using a categorical education variable *
*****************************************************************************************************************************
*(1) Voting for M5S
logit Grillo_ChamberorSenate_all noparty i.EducationCat Age_Cat01 Employment01 Sample if totalwaves==5 & Turnout_W5==1, noomit

*(2) Voting for M5S: Interaction with Education
logit Grillo_ChamberorSenate_all noparty##i.EducationCat Age_Cat01 Employment01 Sample if totalwaves==5 & Turnout_W5==1, noomit

*(3)Grillo Rating
reg NewGrillo_CorrectedforNoParty_W5 noparty i.EducationCat Age_Cat01 Employment01 Sample if totalwaves==5, noomit

*(4) Grillo Rating: Interaction with Education
reg NewGrillo_CorrectedforNoParty_W5 noparty##i.EducationCat i.EducationCat Age_Cat01 Employment01 Sample if totalwaves==5, noomit

*******************************************************************************************************************************************************
* Table A16 - Multinomial logistic regression of leaving the in-party and abstaining, using partisan identity strength as a main independent variable *
*******************************************************************************************************************************************************
mlogit Vote_Type_new2 c.Partisan_ID##i.leftWing_W1 c.Partisan_ID##i.rightWing_W1 Education01 Age_Cat01 Employment01 Sample if totalwaves==5 & PartyID_W1!=12, baseoutcome(3)

**********************************************************************************************************************************************
* Table A17 - Multinomial logistic regression of leaving the in-party and abstaining, using partisan strength as a main independent variable *
**********************************************************************************************************************************************
mlogit Vote_Type_new2 c.PID_Strength##i.leftWing_W1 c.PID_Strength##i.rightWing_W1 Education01 Age_Cat01 Employment01 Sample if totalwaves==5 & PartyID_W1!=12, baseoutcome(3)

**********************************************************************************************************************************************
* Table A18 - Multinomial logistic regression of voting for M5S and voting for another party, with partisan identity strength as a predictor *
**********************************************************************************************************************************************
mlogit Vote_Type_new c.Partisan_ID##i.leftWing_W1 c.Partisan_ID##i.rightWing_W1 Education01 Age_Cat01 Employment01 Sample if totalwaves==5 & PartyID_W1!=12

*************************************************************************************************************************************
* Table A19 - Multinomial logistic regression of voting for M5S and voting for another party, with partisan strength as a predictor *
*************************************************************************************************************************************
mlogit Vote_Type_new c.PID_Strength##i.leftWing_W1 c.PID_Strength##i.rightWing_W1 Education01 Age_Cat01 Employment01 Sample if totalwaves==5 & PartyID_W1!=12
